package com.controller;


import com.pojo.User;
import com.service.UserLoginService;
import com.util.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserLoginService userLoginService;

    @RequestMapping("/login")
    public ResultBean userLogin(User user, HttpSession session){
        ResultBean resultBean = userLoginService.getuserById(user);
        return resultBean;
    }
    @RequestMapping("/register")
    public ResultBean userRegister(User user){
        ResultBean resultBean = userLoginService.UserRegister(user);
        return resultBean;
    }
}
